<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>收银台</title>
<!--header-->
{template _:header}
<style>
.layui-tab {margin:-10px 0 15px 0;}
.layui-form-item .layui-input-inline {margin-right:0;}
#login {background:#EEE;}
#login-content {background:#FFF;width:300px;height:200px;padding:20px;position:absolute;top:50%;left:50%;margin-top:-135px;margin-left:-170px;}
</style>
</head>
<body id="login">
<div id="login-content">
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this"><h3>收银台</h3></li>
		</ul>
	</div>
	<div class="layui-form layui-form-pane">
		<form name="theform" id="theform" method="post" action="{echo url('cash/login')}">
			<div class="layui-form-item">
				<label for="per_phone" class="layui-form-label">店员手机：</label>
				<input type="text" name="per_phone" id="per_phone" class="layui-input layui-input-inline">
			</div>
			<div class="layui-form-item">
				<label for="password" class="layui-form-label">店员密码：</label>
				<input type="password" name="password" id="password" class="layui-input layui-input-inline">
			</div>
			<div class="layui-form-item" style="display:none;">
				<label for="verify" class="layui-form-label">验证：</label><input type="verify" name="verify" id="verify" class="layui-input layui-input-inline">
			</div>
			<div class="layui-form-item" style="text-align:center;">
				<button type="submit" name="submit" value="login" id="submit" class="layui-btn layui-btn-fluid">立即登录</button>
			</div>
		</form>
	</div>
</div>
{template _:footer}
<script type="text/javascript">
$("#theform").ajaxForm({
	dataType: "json",
	timeout: 30000,
	data: {ajax:"json"},
	success: function(data){
		if(data.status == 0) {
			showAlert(data.message);
		} else {
			showInfo(data.message, function(){
				gotourl('{echo url('cash/window')}');
			}, 1000);
		}
	},
	error: function(xhr, status){
		console.log(xhr);
	},
	complete: function(){
		hideLoader();
	},
	beforeSend: function(){
		showLoader();
	}
});
</script>
</body>
</html>